var oArrright = document.getElementById("arrright");
var oArrleft = document.getElementById("arrleft");
var oBox = document.getElementById("box");
var aLlli = oBox.getElementsByTagName("li");
var oNum = document.getElementById("num");
var aAa = oNum.getElementsByTagName("a");
var j=0;

oArrright.onclick = function(){
	for(var i= 0;i<aLlli.length;i++){
		aLlli[i].style.display ='none';
	}
	j++;
	if(j >aLlli.length-1){
		j=0;
	}
	for(var i=0;i<aAa.length;i++){
				aAa[i].removeAttribute("class");
				aAa[i].style.className='';
	}
		aAa[j].setAttribute("class","current");
		aLlli[j].style.display ='block';
}
oArrleft.onclick = function(){
	for(var i= 0;i<aLlli.length;i++){
		aLlli[i].style.display ='none';
	}
	j--;
	if(j<aLlli.length){
		j=0;
	}
	for(var i=0;i<aAa.length;i++){
				//aAa[i].removeAttribute("class");
				aAa[i].style.className='';
	}
		//aAa[j].setAttribute("class","current");
		aLlli[j].style.display ='block';
}
for(var i=0;i<aAa.length;i++){
	var index = aAa[i].index = i;
	aAa[i].onclick = function(){
		for(var  x=0;x<aLlli.length;x++){
			aLlli[x].style.display ='none';
			aAa[x].removeAttribute("class");
			aAa[x].style.className='';
		}
		aLlli[this.index].style.display = 'block';
		this.setAttribute("class","current");
	}
}
